<?php
/**
 * 生成新员工工号
 * @author dinglin
 *
 */
apf_require_controller("HrAbstract");
class Hr_Ajax_UserCodeController extends HrAbstractController {

    public function handle_request() {
        $params = $this->request->get_parameters();
        $user_type = intval($params['user_type']);
        $city_id   = intval($params['city_id']);

        $bll = new Bll_Hr_User();
        $code = $bll->get_user_code($user_type, $city_id);
        if($code){
            $this->json_encode(1,$code);//true
        }else{
            $this->json_encode(0,$code);//error
        }
    }
}